package com.ryenlii.datatrans.adapter;

import cn.hutool.log.StaticLog;

public class SendJoinGroupRequest extends AbstractRequestSend implements ResponseHandleAdapter {
    public RequestFuture sendJoinGroupRequest(String message) {
        return send(message).compose(this);
    }

    @Override
    public void onSuccess(String message, RequestFuture future) {
        StaticLog.info("SendJoinGroupRequest执行结果: {}", message);
        //将结果传播出去
        future.onComplete(message);
    }

    public static void main(String[] args) {
        SendJoinGroupRequest sendJoinGroupRequest = new SendJoinGroupRequest();
        RequestFuture future = sendJoinGroupRequest.sendJoinGroupRequest("测试发送JoinGroup检测请求");
        future.addListener(new RequestFutureListener() {
            @Override
            public void onSuccess(String s) {
                StaticLog.info("我是SendJoinGroupRequest传播出来的，请求为:{}", s);
            }

            @Override
            public void onFail() {
            }
        });
    }
}